package com.uinnova.youshuyun.model;

import lombok.Data;

import java.util.List;

@Data
public class Result<T> {
    /**
     * 请求状态码（1成功 0失败）
    */
    private Integer code;
    private List<T> list;
    private T model;
    private String message;

    public static Result list(List list){
        Result result = new Result<>();
        result.setCode(1);
        result.setList(list);
        return result;
    }

    public static Result error(String message){
        Result result = new Result<>();
        result.setCode(0);
        result.setMessage(message);
        return result;
    }

}
